package palf.visualEffects.transitions {
import flash.display.DisplayObjectContainer;

import palf.visualEffects.layout.Layout;
import palf.visualEffects.utils.PositionData;

public class Arrange {

	private var layout : Layout;

	public function Arrange(layout : Layout) {
		this.layout = layout;
	}

	public function apply(target : DisplayObjectContainer) : void {
		var num_children : uint = target.numChildren;
		var data : PositionData;

		for (var i : uint = 0; i < num_children; i++) {
			data = layout.getLayoutData(i, target.getChildAt(i));
			data.target.x = data.x;
			data.target.y = data.y;
			data.target.alpha = data.alpha;
			data.target.rotation = data.rotation;
		}
	}

}

}
